<%@ page language="java"  pageEncoding="utf-8"%>
<%@page import="com.wu24.bean.*,com.wu24.service.*,java.util.*,com.wu24.util.*"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>主页</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css">

<!-- Font Awesome -->
<link rel="stylesheet" href="css/font-awesome.min.css">

<!-- Custom CSS -->
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<body>

<div class="header-area">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <div class="user-menu">
                        <ul>
                            <li><a href="#"><i class="fa fa-user"></i>欢迎<%=((User)session.getAttribute("user")).getUserName() %>登录</a></li>  
                        </ul>
                    </div>                     
                </div>
            </div>
        </div>
    </div> <!-- End header area -->
    
    <div class="site-branding-area">
        <div class="container">
            <div class="row">
                <div class="col-sm-6">
                    <div class="logo">
                        <h1><a href="index.html"><span>西北大学二手交易市场</span></a></h1>
                    </div>
                </div>
                
              <div class="col-sm-6">
                <p>&nbsp;</p>
                  <p>&nbsp;</p>
                <p>寻你所想 如你所愿
                </p>
              </div>
            </div>
        </div>
    </div> <!-- End site branding area -->
    
    <div class="mainmenu-area">
        <div class="container">
            <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div> 
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="main.jsp">首页</a></li>
                        <li ><a href="shop.jsp">逛一逛</a></li>                
                        <li><a href="cart.jsp">购物车</a></li>
                        <li><a href="upload.jsp">上传商品</a></li>
                       
                    </ul>
                </div>  
            </div>
        </div>
    </div> <!-- End mainmenu area -->


    

<div class="slider-area">
	<div class="zigzag-bottom"></div>
	<div id="slide-list" class="carousel carousel-fade slide" data-ride="carousel">
		
		<div class="slide-bulletz">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<ol class="carousel-indicators slide-indicators">
							<li data-target="#slide-list" data-slide-to="0" class="active"></li>
							<li data-target="#slide-list" data-slide-to="1"></li>
							<li data-target="#slide-list" data-slide-to="2"></li>
						</ol>                            
					</div>
				</div>
			</div>
		</div>

		<div class="carousel-inner" role="listbox">
			<div class="item active">
				<div class="single-slide">
					<div class="slide-bg slide-one"></div>
					<div class="slide-text-wrapper">
						<div class="slide-text">
							<div class="container">
								<div class="row">
									<div class="col-md-6 col-md-offset-6">
										<div class="slide-content">
											<h2>我们方便</h2>
											<p>足不出户，买到称心如意商品；</p>
											<p>动动手指，闲置商品就能卖出；</p>
											<p>校园专卖，助理美好校园生活。</p>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="item">
				<div class="single-slide">
					<div class="slide-bg slide-two"></div>
					<div class="slide-text-wrapper">
						<div class="slide-text">
							<div class="container">
								<div class="row">
									<div class="col-md-6 col-md-offset-6">
										<div class="slide-content">
										  <h2>我们安全</h2>
											<p>成员均为在校学生；</p>
											<p>成员身份真实唯一；</p>
                                            <p>不用担心上当受骗。</p>
									
											
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="item">
				<div class="single-slide">
					<div class="slide-bg slide-three"></div>
					<div class="slide-text-wrapper">
						<div class="slide-text">
							<div class="container">
								<div class="row">
									<div class="col-md-6 col-md-offset-6">
										<div class="slide-content">
										  <h2>我们实惠</h2>
											 <p>同样的商品比价格；</p>
                                              <p>同样的价格比质量；</p>
                                               <p>绝对让你物超所值。</p>
											
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>        
</div> <!-- End slider area -->

<div class="promo-area">
	<div class="zigzag-bottom"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-3 col-sm-6">
				<div class="single-promo">
					<i class="fa fa-refresh"></i>
					<p>循环利用</p>
				</div>
			</div>
			<div class="col-md-3 col-sm-6">
				<div class="single-promo">
					<i class="fa fa-truck"></i>
					<p>不需繁琐</p>
				</div>
			</div>
			<div class="col-md-3 col-sm-6">
				<div class="single-promo">
					<i class="fa fa-lock"></i>
					<p>安全可靠</p>
				</div>
			</div>
			<div class="col-md-3 col-sm-6">
				<div class="single-promo">
					<i class="fa fa-gift"></i>
					<p>惊喜不断</p>
				</div>
			</div>
		</div>
	</div>
</div> <!-- End promo area -->

<div class="maincontent-area">
	<div class="zigzag-bottom"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="latest-product">
					<h2 class="section-title">热门商品</h2>
					<div class="product-carousel">
					<%
                        List<String>ids=CommentService.getHotGood(5);
					    List<Good>goods=new ArrayList<Good>();
					    for(String id:ids){
					    	goods.add(GoodsService.getGoodById(id));
					    }
					    for(Good good:goods){
					%>
					<!--start-->
						<div class="single-product">
							<div class="product-f-image">
								<img src="<%=good.getPhotoPath() %>" alt="">
								<div class="product-hover">
									<a href="trolleyHandler?type=add&id=<%=good.getGoodId() %>"  class="add-to-cart-link"><i class="fa fa-shopping-cart"></i> 加入购物车</a>
									<a href="singleProduct.jsp?id=<%=good.getGoodId() %>" class="view-details-link"><i class="fa fa-link"></i> 查看详情</a>
								</div>
							</div>						
							<h2><a href="singleProduct.jsp?id=<%=good.getGoodId() %>"><%=good.getName() %></a></h2>						
							<div class="product-carousel-price">
								<ins><%=good.getPrice() %>元</ins> 
							</div> 
						</div>
						<!-- end -->
						<%
					    }
						%>
				
					</div>
				</div>
			</div>
			
		</div>
	</div>
</div> <!-- End main content area -->

<div class="brands-area">
	<div class="zigzag-bottom"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="brand-wrapper">
					<h2 class="section-title">商品分类</h2>			
					    <a href="type.jsp?type=0"><img src="img/0.png" alt=""></a>
						 <a href="type.jsp?type=1"><img src="img/1.png" alt=""></a>      
						    <a href="type.jsp?type=2"><img src="img/2.png" alt=""></a>
						 <a href="type.jsp?type=3"><img src="img/3.png" alt=""></a>                    					
				</div>
			</div>
		</div>
	</div>
</div> <!-- End brands area -->

<div class="product-widget-area">
	<div class="zigzag-bottom"></div>
	<div class="container">
		<div class="row">
			<div class="col-md-4">
				<div class="single-product-widget">
				  <h2 class="product-wid-title">点击最多</h2>
					<a href="type.jsp?type=4" class="wid-view-more">查看更多</a>
					
				<%
				 List<Good>goodsByComment=GoodsService.getGoods(1,3,"4",null);
				for(Good good:goodsByComment){
				
				%>
					<div class="single-wid-product">
						<a  href="singleProduct.jsp?id=<%= good.getGoodId()%>"><img src="<%=good.getPhotoPath() %>" alt="" class="product-thumb"></a>
					  <h2><a href="singleProduct.jsp?id=<%= good.getGoodId()%>"><%=good.getName() %></a></h2>
						<div class="product-wid-rating">
							<i class="fa fa-star"></i>
							
							<i class="fa fa-star"></i>
						</div>
						<div class="product-wid-price">
							<ins><%=good.getPrice() %>元</ins> 
						</div>                            
				  </div>
				  <%
				}
				  %>
				</div>
			</div>
			<div class="col-md-4">
				<div class="single-product-widget">
				  <h2 class="product-wid-title">限时特价</h2>
					<a href="type.jsp?type=5" class="wid-view-more">查看更多</a>		
				<%
				List<Good>goodsByPrice=GoodsService.getGoods(1,3,"5",null);
				for(Good good:goodsByPrice){
			
				%>
					<div class="single-wid-product">
						<a href="singleProduct.jsp?id=<%=good.getGoodId() %>"><img width="20" height="40" src="<%=good.getPhotoPath() %>" alt="" class="product-thumb"></a>
					  <h2><a href="singleProduct.jsp?id=<%=good.getGoodId() %>"><%=good.getName() %></a></h2>
						<div class="product-wid-rating">
							<i class="fa fa-star"></i>
							
						</div>
						<div class="product-wid-price">
							<ins><%=good.getPrice() %>元</ins>
						</div>                            
				  </div>
				  <%
				}
				  %>
				</div>
			</div>
			<div class="col-md-4">
				<div class="single-product-widget">
				  <h2 class="product-wid-title">最新上架</h2>
					<a href="type.jsp?type=6" class="wid-view-more">查看更多</a>
				<%
				List<Good>goodsByTime=GoodsService.getGoods(1,3,"6",null);
				for(Good good:goodsByTime){
			
				
				%>
					<div class="single-wid-product">
						<a href="singleProduct.jsp?id=<%=good.getGoodId()%>"><img src="<%=good.getPhotoPath() %>" alt="" class="product-thumb"></a>
					  <h2><a href="singleProduct.jsp?id=<%=good.getGoodId()%>"><%=good.getName() %></a></h2>
						<div class="product-wid-rating">
							
							<i class="fa fa-star"></i>
							
							
						</div>
						<div class="product-wid-price">
							<ins><%=good.getPrice() %>元</ins> 
						</div>                            
				  </div>
			<%
				}
			%>
				</div>
			</div>
		</div>
	</div>
</div> <!-- End product widget area -->



<div class="footer-top-area">
        <div class="zigzag-bottom"></div>
        <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="footer-about-us">
                        <h2>声明<span></span></h2>
                        <p>本网站仅做测试使用，如有侵权，请联系我们。</p>
             
                    </div>
                </div>
                
                <div class="col-md-3 col-sm-6">
                    <div class="footer-menu">
                        <h2 align="center" class="footer-wid-title">如果不满意</h2>
                        <ul><li>
                          <div align="center"><a href="">淘宝</a></div>
                        </li>
                            <li>
                              <div align="center"><a href="">苏宁易购</a></div>
                            </li>
                            <li>
                              <div align="center"><a href="">58同城</a></div>
                            </li>
                            <li>
                              <div align="center"><a href="">转转</a></div>
                            </li>
                            <li>
                              <div align="center"><a href="">唯品会</a></div>
                            </li>
                        </ul>                        
                  </div>
                </div>
                
                <div class="col-md-3 col-sm-6">
                    <div class="footer-menu">
                        <h2 align="center" class="footer-wid-title">请点击这里</h2>
                    <ul>
                            <li>
                              <div align="center"><a href="">淘宝</a></div>
                        </li>
                          <li>
                            <div align="center"><a href="">京东</a></div>
                      </li>
                          <li>
                            <div align="center"><a href="">天猫</a></div>
                      </li>
                          <li>
                            <div align="center">蘑菇街<a href=""></a></div>
                          </li>
                        <li>
                              <div align="center"><a href="">赶集网</a></div>
                        </li>
                      </ul>                        
                    </div>
                </div>
                
                <div class="col-md-3 col-sm-6">
                    <div class="footer-newsletter">
                        <h2 align="center" class="footer-wid-title">或者联系我们</h2>
                      <p>如果你对我们的工作不满意，请输入您的建议</p>
                        <div class="newsletter-form">
                            <input type="email" placeholder="请输入您的建议">
                            <input type="submit" value="提交">
                        </div>
                    </div>
                </div>
            </div>
        </div>
</div>
  
   
</body>
</html>

<!-- Latest jQuery form server -->
<script src="js/jquery-1.8.3.min.js"></script>

<!-- Bootstrap JS form CDN -->
<script src="js/bootstrap.min.js"></script>

<!-- jQuery sticky menu -->
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.sticky.js"></script>

<!-- jQuery easing -->
<script src="js/jquery.easing.1.3.min.js"></script>

<!-- Main Script -->
<script src="js/main.js"></script>
</body>
</html>